
import request from '@/utils/request';
import { toFormData } from '@/utils/utils';
import { stringify } from 'qs';

export default {
	//订单付款接口-单个和批量
	updateBatchPay(params) {
		return request(`/zjf-oms/order/batchPay`, {
			method: 'POST',
			data: params,
		});
	},

	//优惠券可用验证
	validateCouponOp(params) {
		return request(`/zjf-oms/expresscoupon/validateCoupon?${stringify(params)}`);
	},

	//提交拆分订单支付
	upDateSplitOrder(params) {
		return request(`/zjf-oms/order/splitOrder`, {
			method: 'POST',
			data: params,
		});
	},

	//支付完成单个增加商品
	payFinishUpdateOrderGoods(params) {
		return request(`/zjf-oms/ordergoods/payFinishUpdateOrderGoods`, {
			method: 'POST',
			body: toFormData(params),
		});
	},

	//支付完成批量增加商品
	payFinishBatchAddOrderGoods(params) {
		return request(`/zjf-oms/ordergoods/payFinishBatchAddOrderGoods`, {
			method: 'POST',
			body: toFormData(params),
		});
	},

	//自动代替用户取消异常
	autoCancelErrorOp(params) {
		return request(`/zjf-oms/exception/auto/cancel?${stringify(params)}`);
	},

	//更换商品(商城)
	exchangeGoods(params) {
		return request(`/zjf-oms/mallOrder/exchange`, {
			method: 'POST',
			data: params,
		});
	},

	//一键处理商品异常
	oneKeygoodsExceptionHandle(params) {
		return request('/zjf-oms/exception/oneKeygoodsExceptionHandle', {
			method: 'post',
			data: params,
		});
	},

	//已售汇总-生成备货单支付
	payBackupOrder(params) {
		return request('/zjf-wms/stockup/toPay', {
			method: "post",
			data: params
		});
	},
}
